/* 储存基础控件字段 */

import { IcomponentItem } from '../types';

// 储存控件属性
export const baseControl: IcomponentItem[] = [
  {
    componentName: '单行文本',
    componentType: 'TEXT',
    code: 'TEXT',
    icon: 'icon-danhangwenben',
    showFieldList: ['validate', 'textMax', 'placeholder'],
    props: {
      placeholder: '请输入文字'
    },
    fieldName: 'text'
  },
  {
    componentName: '多行文本',
    componentType: 'TEXT_AREA',
    code: 'TEXT_AREA',
    icon: 'icon-duohangwenben',
    showFieldList: ['textMax', 'placeholder'],
    fieldName: 'textArea',
    props: {
      placeholder: '请输入文字'
    }
  },
  {
    componentName: '数字',
    componentType: 'NUMBER',
    code: 'TEXT_NUMBER',
    icon: 'icon-shuzi',
    showFieldList: ['textMax', 'placeholder'],
    fieldName: 'number',
    props: {
      placeholder: '请输入数字'
    }
  },

  {
    componentName: '日期',
    componentType: 'DATE',
    code: 'DATE',
    icon: 'icon-calendar',
    showFieldList: ['placeholder', 'dateFormat', 'showTime'],
    fieldName: 'date',
    props: {
      placeholder: '请输入日期',
      dateFormat: 'YYYY-MM-DD HH:mm:ss', // 时间格式
      showTime: true, // 是否为带日期的选择器
      valueFormat: 'x' // 传给后端的时间格式(默认为时间戳)
    }
  },
  {
    componentName: '日期(周)',
    componentType: 'DATE',
    code: 'DATE_WEEK',
    icon: 'icon-calendar',
    showFieldList: ['placeholder'],
    fieldName: 'dateWeek',
    props: {
      placeholder: '请输入日期',
      valueFormat: 'x' // 传给后端的时间格式(默认为时间戳)
    }
  },
  {
    componentName: '日期(月)',
    componentType: 'DATE',
    code: 'DATE_MONTH',
    icon: 'icon-calendar',
    showFieldList: ['placeholder'],
    fieldName: 'dateMonth',
    props: {
      placeholder: '请输入日期',
      dateFormat: 'YYYY-MM-DD HH:mm:ss', // 时间格式
      showTime: true, // 是否为带日期的选择器
      valueFormat: 'x' // 传给后端的时间格式(默认为时间戳)
    }
  },
  {
    componentName: '日期(年)',
    componentType: 'DATE',
    code: 'DATE_YEAR',
    icon: 'icon-calendar',
    showFieldList: ['placeholder'],
    fieldName: 'dateYear',
    props: {
      placeholder: '请输入日期',
      valueFormat: 'x' // 传给后端的时间格式(默认为时间戳)
    }
  },
  {
    componentName: '日期(季度)',
    componentType: 'DATE',
    code: 'DATE_QUARTER',
    icon: 'icon-calendar',
    showFieldList: ['placeholder'],
    fieldName: 'dateQuarter',
    props: {
      placeholder: '请输入日期',
      valueFormat: 'x' // 传给后端的时间格式(默认为时间戳)
    }
  },

  {
    componentName: '日期范围',
    componentType: 'DATE',
    code: 'DATE_RANGE',
    icon: 'icon-calendar',
    showFieldList: ['placeholder', 'dateFormat', 'showTime'],
    fieldName: 'dateRange',
    props: {
      placeholder: '请输入日期',
      format: 'YYYY-MM-DD HH:mm:ss', // 时间格式
      showTime: true, // 带日期的选择器
      valueFormat: 'x' // 传给后端的时间格式(默认为时间戳)
    }
  },
  {
    componentName: '下拉选择框',
    componentType: 'SELECT',
    code: 'SELECT',
    icon: 'icon-xialaxuanze',
    showFieldList: ['placeholder', 'selectOptions'],
    fieldName: 'select',
    props: {}
  },
  {
    componentName: '单选框',
    componentType: 'RADIO',
    code: 'RADIO',
    icon: 'icon-danxuankuang',
    showFieldList: ['placeholder', 'radioOptions'],
    fieldName: 'radio',
    props: {}
  },
  {
    componentName: '多选框',
    componentType: 'CHECK_BOX',
    code: 'CHECK_BOX',
    icon: 'icon-danxuankuang',
    showFieldList: ['max', 'checkBoxOptions'],
    fieldName: 'checkBox',
    props: {
      // options:{}
    }
  },
  {
    componentName: '单文件上传',
    componentType: 'FILE',
    code: 'SINGLE_FILE',
    icon: 'icon-fujian',
    showFieldList: ['placeholder'],
    fieldName: 'singleFile',
    props: {}
  },
  {
    componentName: '多文件上传',
    componentType: 'FILE',
    code: 'MULTI_FILE',
    icon: 'icon-fujian',
    showFieldList: ['placeholder'],
    fieldName: 'multiFile',
    props: {}
  },
  {
    componentName: '单图片上传',
    componentType: 'FILE',
    code: 'SINGLE_PICTURE',
    icon: 'icon-fujian',
    showFieldList: ['placeholder'],
    fieldName: 'singlePicture',
    props: {}
  },
  {
    componentName: '多图片上传',
    componentType: 'FILE',
    code: 'MULTI_PICTURE',
    icon: 'icon-fujian',
    showFieldList: ['placeholder'],
    fieldName: 'multiPicture',
    props: {}
  }
];

// 储存控件的字段名
export const baseControlField = [
  'TEXT',
  'TEXT_AREA',
  'TEXT_NUMBER',
  'DATE',
  'DATE_WEEK',
  'DATE_MONTH',
  'DATE_YEAR',
  'DATE_QUARTER',
  'DATE_RANGE',
  'SELECT',
  'RADIO',
  'CHECK_BOX',
  'SINGLE_FILE',
  'MULTI_FILE',
  'SINGLE_PICTURE',
  'MULTI_PICTURE'
];
